package org.example.ychdp.controller;

import org.example.ychdp.entity.Concert;
import org.example.ychdp.service.ConcertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class concertController {

    @Autowired
    private ConcertService concertService;

    @RequestMapping("/viewConcert")
    public ModelAndView viewConcert() {
        List<Concert> concertList = concertService.selectAllConcert();
        Map<String,Object> model = new HashMap<String,Object>();
        model.put("ConcertL",concertList);

        ModelAndView modelAndView = new ModelAndView("concert/concertList",model);
        return modelAndView;
    }


}
